import { getResume } from "@/lib/api";
import ResumeEditor from "./components/resume-editor";
import { DEMO_RESUME_DATA } from "@/app/templates/utils/Resume";

export default async function ResumePage({
  params,
}: {
  params: Promise<{ id: string }>;
}) {
  const { id } = await params;
  const resume =
    id !== "create"
      ? await getResume(id)
      : {
          jsonString: JSON.stringify(DEMO_RESUME_DATA),
          remarks: "Template01",
        };

  return <ResumeEditor value={resume} />;
}
